﻿using System.Configuration;

namespace Altairis.Nemesis.Gallery.Configuration {
    public class DirectoryListingElement : ConfigurationElement {

        [ConfigurationProperty("enabled", IsRequired = false, DefaultValue = true)]
        public bool Enabled {
            get { return (bool)this["enabled"]; }
            set { this["enabled"] = value; }
        }

        [ConfigurationProperty("template", IsRequired = false, DefaultValue = "~/App_Data/Templates/Default/DirectoryListing.xsl")]
        public string Template {
            get { return (string)this["template"]; }
            set { this["template"] = value; }
        }

        [ConfigurationProperty("cacheTimeout", IsRequired = false, DefaultValue = 60)]
        [IntegerValidator(MinValue = 0)]
        public int CacheTimeout {
            get { return (int)this["cacheTimeout"]; }
            set { this["cacheTimeout"] = value; }
        }

        [ConfigurationProperty("varyByParams", IsRequired = false, DefaultValue = false)]
        public bool VaryByParams {
            get { return (bool)this["varyByParams"]; }
            set { this["varyByParams"] = value; }
        }

        [ConfigurationProperty("excludeSystemFolders", IsRequired = false, DefaultValue = true)]
        public bool ExcludeSystemFolders {
            get { return (bool)this["excludeSystemFolders"]; }
            set { this["excludeSystemFolders"] = value; }
        }

        [ConfigurationProperty("fileMask", IsRequired = false, DefaultValue = "*.jpg")]
        public string FileMask {
            get { return (string)this["fileMask"]; }
            set { this["fileMask"] = value; }
        }

        [ConfigurationProperty("folderMask", IsRequired = false, DefaultValue = "*.*")]
        public string FolderMask {
            get { return (string)this["folderMask"]; }
            set { this["folderMask"] = value; }
        }

    }
}
